<?php

namespace app\validate\admin;

use app\common\validate\BaseValidate;

/**
 * Class Validate
 * https://www.kancloud.cn/manual/thinkphp6_0/1037624
 * @package app\daily\validate
 */
class Member extends BaseValidate
{
    //定义验证规则
    protected $rule = [
        'type|操作类型' => 'require|number',
        'assistant_id|助教id' => 'require|number',
        'nickname|昵称' => 'require|max:10|unique:member',
        'avatar|头像' => 'require',
        'profile|简介' => 'require',
        'per_price|价格' => 'require',
        'sign|签名' => 'require',
        'member_id|用户id' => 'require',
        'grade_id|等级id' => 'require',
        'star|星数' => 'require',
        'store_id|门店id' => 'require',
        'is_recommend|推荐' => 'require',
    ];

    //定义验证场景要与方法名相同走自动验证
    protected $scene = [
        'bind' => [
            'type', 'assistant_id'
        ],
        'create_assistant' => ['type', 'nickname', 'avatar', 'profile', 'sign', 'per_price', 'member_id', 'grade_id', 'star', 'store_id', 'is_recommend']
    ];

}
